#ifndef __TASK_GEN_INTERFACE_H__
#define __TASK_GEN_INTERFACE_H__

#include <tasks_manager/base_define.h>
#include <tasks_manager/msg_convert.h>
#include <tasks_manager/log_save.h>

#include <cln_msgs/CleanTask.h>
#include <cln_msgs/CoverPathGen.h>
#include <cln_msgs/GenerateHandPoly.h>
#include <cln_msgs/GenerateTeachPath.h>

class PathGenInterface{
    public:
        PathGenInterface();
        ~PathGenInterface();

        /*******************************************
         * 旧接口 ROS服务接口
         *******************************************/
        // 生成区域任务路径
        Status GenPolygonTaskWithClnMsg(TaskSingle& task_packed, bool only_gen_area = false);
        // 生成手推路线
        Status GenHandLineWithClnMsg(TaskSingle& task_packed);
        // 生成手推区域轮廓
        Status GenHandPolygonWithClnMsg(TaskSingle& task_packed, bool is_preview);

        /*******************************************
         * 新接口 ROS服务接口
         *******************************************/
        Status PathGenerateRequest(ros::ServiceClient& client, TaskSingle& task_packed, bool is_preview);
        // 生成区域任务路径
        Status GenPolygonTaskWithV3Msg(TaskSingle& task_packed, bool is_preview);
        // 生成手推路线
        Status GenHandPathWithV3Msg(TaskSingle& task_packed, bool is_preview);
        // 生成P2P轮廓
        Status GenP2PPathWithV3Msg(TaskSingle& task_packed);

    private:
        ros::NodeHandle __nh;
        // 旧版本接口，此处兼容适配
        ros::ServiceClient __all_sparse_client;             //任务路径生成
        ros::ServiceClient __teach_path_gen_client;         //示教路径生成
        ros::ServiceClient __hand_poly_gen_client;          //手推区域任务生成
        ros::ServiceClient __hand_poly_preview_client;      //手推区域任务预览
        // 新版本接口
        ros::ServiceClient __hand_path_client;
        ros::ServiceClient __p2p_path_client;
        ros::ServiceClient __cover_path_client; 

    private:
        MsgConvert __msg_convert;
};


#endif